import pygame

class BlackBird:
    def __init__(self,bird_game):
        self.screen = bird_game.screen
        # 获取屏幕的矩形
        self.screen_rect = bird_game.screen.get_rect()

        self.image = pygame.image.load('day21/images/blackbird.bmp')
        self.rect = self.image.get_rect()
        # 使用屏幕矩形的center属性
        self.rect.center = self.screen_rect.center

    def blitme(self):
        self.screen.blit(self.image,self.rect)